/**
 * 用户页面处理商品信息
 */

import request from "@/request";

/**
 * 分页查询全部待售商品
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function getAllCommodityUser(formData) {
    return request({
        // url: '/user/commodity/sale/all',
        url: '/merchant/commodity/definedMerchant/ready',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}

/**
 * 根据商品id查询商品信息
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function getCommodityById(formData) {
    return request({
        url: '/user/commodity/select/id',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}

/**
 * 根据商品名称查询商品信息
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function searchCommodityByText(formData) {
    return request({
        url: '/merchant/commodity/definedMerchant/text',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}